package com.baitengsoft.patentapimonitor.common.configure;

/**
 * Created by Admin on 2017/12/15.
 */

import java.util.Properties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import tk.mybatis.spring.mapper.MapperScannerConfigurer;
@Configuration
public class MyBatisMapperScannerConfig {

    @Bean
    public MapperScannerConfigurer mapperScannerConfigurer() {
        MapperScannerConfigurer mapperScannerConfigurer = new MapperScannerConfigurer();
        mapperScannerConfigurer.setSqlSessionFactoryBeanName("sqlSessionFactory");
        mapperScannerConfigurer.setBasePackage("com.baitengsoft.patentapimonitor.api.dao.*Dao");//扫描该路径下的dao
        Properties properties = new Properties();
        properties.setProperty("mappers", "com.baitengsoft.patentapimonitor.api.dao.BasetkRepository");//通用dao
        properties.setProperty("notEmpty", "false");
        properties.setProperty("IDENTITY", "MYSQL");
        mapperScannerConfigurer.setProperties(properties);
        return mapperScannerConfigurer;
    }
}
